package com.xsb.aidl.service

import android.app.Service
import android.content.Intent
import android.os.Binder
import android.os.IBinder
import android.util.Log
import com.xsb.aidl.IDataInterface

/**
 *     author : 薛少博
 *     e-mail : xsb@zlhopesun.com
 *     time   : 2021/6/8
 *     desc   : 类说明
 */
class MyService : Service() {
    var myBinder  = MyBinder();
     class MyBinder : IDataInterface.Stub(){
         override fun getStringName() {

         }

         override fun addNum(a: Int, b: Int) {
             println(a+b)
         }
     }

    override fun onBind(intent: Intent?): IBinder? {
        return myBinder
    }

    override fun onCreate() {
        super.onCreate()
        Log.i("Myservice", "onCreate: ")
    }

    override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
        return super.onStartCommand(intent, flags, startId)
        Log.i("Myservice", "onStartCommand: ")
    }

    override fun onDestroy() {
        super.onDestroy()
        Log.i("Myservice", "onDestroy: ")
    }
}